<template>
  <div id="app">
    <!--<login></login>-->
    <!--<index></index>-->
    <component :is="initPage" ></component>


  </div>
</template>
<script>
    import Index from './components/index.vue';

    import Login from './components/login.vue';

    export default {

        name: 'app',

        data: function () {
            return{
                initPage : 'login',
            }
        },
        components: {
            'index':Index,
            'login':Login
        },
        created: function () {

//            console.log("建立");
//            console.log(sessionStorage.getItem('user_token'));
//            console.log(location.pathname);

            if (location.pathname == '/index'){
                this.initPage = 'index';
            }

        },
    };
</script>
